﻿<Window x:Class="CPPEI.Coolzon.Designer.Views.PublishDataSourceToFileSystemWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:CPPEI.Coolzon.Designer.Views"
        mc:Ignorable="d"
        Title="发布数据源到本地" Height="350" Width="700"
          Style="{DynamicResource WindowStyle}" Loaded="Window_Loaded">

    <Grid >
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <Grid Grid.Row="0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="130"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="40"/>
            </Grid.ColumnDefinitions>
            <TextBlock Grid.Column="0" FontSize="16" Text="请选择发布目录:" Margin="3,5,3,3" HorizontalAlignment="Right" />
            <TextBox x:Name="_ctlPublishDir" Grid.Column="1" Margin="3" IsReadOnly="True" />
            <Button Style="{DynamicResource ShortButtonStyle}" Click="selectDirButton_Click" Grid.Column="2" Content="..." Width="30"  Margin="5,3,3,3" />
        </Grid>
        <TextBlock Grid.Row="1" Text="数据源:" Margin="15,0,0,0" FontSize="16"/>
        <ListView Grid.Row="2"  x:Name="_ctlListView" AlternationCount="2" >
            <ListView.View >
                <GridView>
                    <GridView.Columns>
                        <GridViewColumn>
                            <GridViewColumn.HeaderTemplate>
                                <DataTemplate>
                                    <Grid>
                                        <CheckBox x:Name="_cbAll" Content="全选" Click="_cbAll_Click" IsChecked="True" ></CheckBox>
                                    </Grid>
                                </DataTemplate>
                            </GridViewColumn.HeaderTemplate>
                            <GridViewColumn.CellTemplate>
                                <DataTemplate DataType="local:PublishDataSourceToServerModel">
                                    <StackPanel Orientation="Horizontal" Margin="0,3,0,3" HorizontalAlignment="Left">
                                        <CheckBox IsChecked="{Binding Path=IsChecked, Mode=TwoWay}" Margin="3,0,0,0"/>
                                    </StackPanel>
                                </DataTemplate>
                            </GridViewColumn.CellTemplate>
                        </GridViewColumn>
                        <GridViewColumn>
                            <GridViewColumn.HeaderTemplate>
                                <DataTemplate>
                                    <Grid>
                                        <TextBlock HorizontalAlignment="Center" Width="Auto" Margin="2" Text="名称"/>
                                    </Grid>
                                </DataTemplate>
                            </GridViewColumn.HeaderTemplate>
                            <GridViewColumn.CellTemplate>
                                <DataTemplate DataType="local:PublishDataSourceToServerModel">
                                    <StackPanel Orientation="Horizontal" Margin="0,3,0,3">
                                        <TextBlock Text="{Binding Path=Name}" Margin="5,0,0,0" ></TextBlock>
                                    </StackPanel>
                                </DataTemplate>
                            </GridViewColumn.CellTemplate>
                        </GridViewColumn>
                        <GridViewColumn>
                            <GridViewColumn.HeaderTemplate>
                                <DataTemplate >
                                    <Grid>
                                        <TextBlock HorizontalAlignment="Center" Width="Auto"  Margin="2" Text="版本" />
                                    </Grid>
                                </DataTemplate>
                            </GridViewColumn.HeaderTemplate>
                            <GridViewColumn.CellTemplate>
                                <DataTemplate DataType="local:PublishDataSourceToServerModel">
                                    <StackPanel Orientation="Horizontal" Margin="0,3,0,3">
                                        <TextBlock Text="{Binding Path=RTVersion}" Margin="5,0,0,0" ></TextBlock>
                                    </StackPanel>
                                </DataTemplate>
                            </GridViewColumn.CellTemplate>
                        </GridViewColumn>
                        <GridViewColumn>
                            <GridViewColumn.HeaderTemplate>
                                <DataTemplate>
                                    <Grid>
                                        <TextBlock HorizontalAlignment="Center" Width="Auto"  Margin="2" Text="发布版本"/>
                                    </Grid>
                                </DataTemplate>
                            </GridViewColumn.HeaderTemplate>
                            <GridViewColumn.CellTemplate>
                                <DataTemplate DataType="local:PublishDataSourceToServerModel">
                                    <TextBlock Text="{Binding Path=PublishedVersion}" Margin="10"></TextBlock>
                                </DataTemplate>
                            </GridViewColumn.CellTemplate>
                        </GridViewColumn>
                        <GridViewColumn Header="发布时间">
                            <GridViewColumn.CellTemplate>
                                <DataTemplate DataType="local:PublishDataSourceToServerModel">
                                    <TextBlock HorizontalAlignment="Center"  Text="{Binding Path=PublishedTime}" Width="Auto" Margin="10"></TextBlock>
                                </DataTemplate>
                            </GridViewColumn.CellTemplate>
                        </GridViewColumn>
                    </GridView.Columns>
                </GridView>
            </ListView.View>
        </ListView>
        <Grid Grid.Row="3">
            <StackPanel Margin="5" Orientation="Horizontal" HorizontalAlignment="Center">
                <Button Style="{DynamicResource  SubmitOrCancelButtonStyle}"  Content="发布" Margin="0,0,20,0" Click="Button_Click" />
                <Button Style="{DynamicResource  SubmitOrCancelButtonStyle}"  Name="cancel" Content="取消" Margin="20,0,0,0" Click="cancel_Click"></Button>
            </StackPanel>
        </Grid>
    </Grid>
</Window>
